<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_search
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
?>
<div id="custom-page-heading">
	<h1 class="heading">Search</h1>
</div>
<div style="margin-bottom:10px;"><?php echo count($this->results)?> Result(s) Found</div>
<div id="lstRelateArticle" class="clearfix">
	<ul id="listArticle">
	  <?php foreach($this->results as $result) : ?>
		  <li><a href="<?php echo JRoute::_($result->href); ?>"><?php echo $this->escape($result->title); ?></a></li>
		<?php endforeach; ?>
	</ul>
</div> 

<?php return; ?>
<div class="search<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
	<?php if ($this->escape($this->params->get('page_heading'))) :?>
		<?php echo $this->escape($this->params->get('page_heading')); ?>
	<?php else : ?>
		<?php echo $this->escape($this->params->get('page_title')); ?>
	<?php endif; ?>
</h1>
<?php endif; ?>

<?php echo $this->loadTemplate('form'); ?>
<?php if ($this->error==null && count($this->results) > 0) :
	echo $this->loadTemplate('results');
else :
	echo $this->loadTemplate('error');
endif; ?>
</div>
